﻿using System.Windows;
using System.Windows.Interactivity;

namespace Orktane.Sample.ConsoleApp.Behaviors
{
    public class TargetedToggleVisiblityAction : TargetedTriggerAction<UIElement>
    {
        protected override void Invoke(object parameter)
        {
            if (this.Target == null) return;
            var _target = this.Target;
            _target.Visibility = (_target.Visibility == System.Windows.Visibility.Visible)
                        ? System.Windows.Visibility.Collapsed : System.Windows.Visibility.Visible;
        }
    }
}
